using System.Collections;
using UnityEngine;

public class AudioController : MonoBehaviour
{
	private AudioSource fxSound;

	public AudioSource MusicBackground;

	public AudioClip ButtonUpgradeShop;

	public AudioClip ButtonAllGame;

	public AudioClip KatanaStartGame;

	public AudioClip PlayerDam;

	public AudioClip Win;

	public AudioClip PlayerKatana;

	public AudioClip PlayerGay;

	public AudioClip PlayerSkillGay2;

	public AudioClip PlayerSkillDao1;

	public AudioClip PlayerSkillDao2;

	public AudioClip PlayerSkillCloud2;

	public AudioClip PlayerClaw;

	public AudioClip PlayerEatItem;

	public AudioClip PlayerDeath;

	public AudioClip EnemyDeath;

	public AudioClip PlayerGetHit;

	public AudioClip Blood;

	public AudioClip Boss123Die;

	public AudioClip Boss4Die;

	public AudioClip lazeBoss3;

	public AudioClip PlayLazeBoss3;

	public AudioClip BoomBoss3;

	public AudioClip PlayerCross;

	public AudioClip PlayerAxe;

	public AudioClip PlayerKich;

	public static AudioController Instance
	{
		get;
		private set;
	}

	private void Awake()
	{
		if (Instance != null && Instance != this)
		{
			UnityEngine.Object.Destroy(base.gameObject);
			return;
		}
		Instance = this;
		Object.DontDestroyOnLoad(base.gameObject);
	}

	public void PlayButtonUpgradeShop()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(ButtonUpgradeShop));
		}
	}

	public void SoundButtonAllGame()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(ButtonAllGame));
		}
	}

	public void SoundKatanaStartGame()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(KatanaStartGame));
		}
	}

	public void SoundPlayerDam()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerDam));
		}
	}

	public void SoundPlayerPlayerKatana()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerKatana));
		}
	}

	public void SoundPlayerGetHit()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerGetHit));
		}
	}

	public void SoundPlayerDeath()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerDeath));
		}
	}

	public void SoundPlayerPlayerGay()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerGay));
		}
	}

	public void SoundPlayerSkillGay2()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerSkillGay2));
		}
	}

	public void SoundPlayerPlayerClaw()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerClaw));
		}
	}

	public void SoundPlayerSkillDao1()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerSkillDao1));
		}
	}

	public void SoundPlayerSkillDao2()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerSkillDao2));
		}
	}

	public void SoundPlayerSkillCloud2()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerSkillCloud2));
		}
	}

	public void SoundPlayerPlayerCross()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerCross));
		}
	}

	public void SoundPlayerEatItem()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerEatItem));
		}
	}

	public void SoundBlood()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(Blood));
		}
	}

	public void SoundEnemyDeath()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(EnemyDeath));
		}
	}

	public void SoundBoss123Die()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(Boss123Die));
		}
	}

	public void SoundBoss4Die()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(Boss4Die));
		}
	}

	public void SoundWinner()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(Win));
		}
	}

	public void SoundPlayeLazeBoss3()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayLazeBoss3));
		}
	}

	public void SoundLazeBoss3()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(lazeBoss3));
		}
	}

	public void SoundBoomBoss3()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(BoomBoss3));
		}
	}

	public void SoundPlayerAxe()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerAxe));
		}
	}

	public void SoundPlayerKich()
	{
		if (GameManager.key_sound == 1)
		{
			StartCoroutine(PlaySound(PlayerKich));
		}
	}

	private IEnumerator PlaySound(AudioClip clip)
	{
		GameObject go = new GameObject("Audio: " + clip.name);
		AudioSource source = go.AddComponent<AudioSource>();
		source.clip = clip;
		go.GetComponent<AudioSource>().PlayOneShot(clip);
		yield return new WaitForSeconds(clip.length);
		UnityEngine.Object.Destroy(go);
	}
}
